package com.lc.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

import com.cnpc.framework.utils.DateUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;

/**
 * @Description
 * @Author Nomaj
 * @Date 2022-03-09
 */

@Setter
@Getter
@ToString
@Entity
@Table(name = "app_note")
public class AppNote implements Serializable {

    private static final long serialVersionUID = 6176853772160429561L;

    @Id
    @GenericGenerator(name = "id", strategy = "uuid")
    @GeneratedValue(generator = "id")
    @Column(name = "id", length = 36)
    private String id;

    @Column(name = "createtime")
    private String createtime;

    @Column(name = "updatetime")
    private String updatetime;

    @Column(name = "deptId")
    private String deptId;

    /**
     * 添加人
     */
    @Column(name = "userId")
    private String userId;

    /**
     * 日期
     */
    @Column(name = "noteDate")
    private String noteDate;

    /**
     * 时间
     */
    @Column(name = "noteTime")
    private String noteTime;

    /**
     * 标题
     */
    @Column(name = "noteTitle")
    private String noteTitle;

    /**
     * 内容
     */
    @Column(name = "noteContent")
    private String noteContent;

	public void setDefaultTime(){
		String dateTime = DateUtil.format(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS);
		createtime = dateTime;
		updatetime = dateTime;
	}

	public void setDefaultCreateTime(){
		String dateTime = DateUtil.format(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS);
		createtime = dateTime;
	}

	public void setDefaultUpdateTime(){
		String dateTime = DateUtil.format(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS);
		updatetime = dateTime;
	}

}
